package cn.zwx.activiti.example.common.exception;

import cn.zwx.activiti.example.common.enums.ErrorEnum;

/**
 * @description:
 * @projectName:activiti-example
 * @see:cn.zwx.activiti.example.common.exception
 * @author:zhangwenxue
 * @createTime:2021/5/29 11:12
 * @version:1.0
 */

public class BizException extends RuntimeException {

    protected Integer errorCode;
    protected String errorMsg;

    public BizException(){
    }
    public BizException(Integer errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public BizException(ErrorEnum errorEnum) {
        this.errorCode = errorEnum.getErrorCode();
        this.errorMsg = errorEnum.getErrorMsg();
    }


    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

}
